From 526fecc2f942a2cbd3fe831f288fad60e26f1f49 Mon Sep 17 00:00:00 2001 From: Richard Hult Date: Sat, 16 Jun 2007 21:21:52 +0000 Subject: [PATCH] Defer setting the parent until the window is shown, otherwise it gets 2007-06-16 Richard Hult * gdk/quartz/gdkwindow-quartz.c: (gdk_window_set_transient_for): Defer setting the parent until the window is shown, otherwise it gets unconditionally shown here. svn path=/trunk/; revision=18164 --- ChangeLog | 6 ++++++ gdk/quartz/gdkwindow-quartz.c | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fcd4e51935..a7d7b19224 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-06-16 Richard Hult + + * gdk/quartz/gdkwindow-quartz.c: (gdk_window_set_transient_for): + Defer setting the parent until the window is shown, otherwise it + gets unconditionally shown here. + 2007-06-16 Johan Dahlin * gtk/gtkbuilderparser.c (text): Swap argument order to dgettext diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c index 5329ff0cf1..f538e2100f 100644 --- a/gdk/quartz/gdkwindow-quartz.c +++ b/gdk/quartz/gdkwindow-quartz.c @@ -1585,7 +1585,13 @@ gdk_window_set_transient_for (GdkWindow *window, if (gdk_window_get_type_hint (window) != GDK_WINDOW_TYPE_HINT_TOOLTIP) { window_impl->transient_for = g_object_ref (parent); - [parent_impl->toplevel addChildWindow:window_impl->toplevel ordered:NSWindowAbove]; + + /* We only add the window if it is shown, otherwise it will + * be shown unconditionally here. If it is not shown, the + * window will be added in show() instead. + */ + if (!(GDK_WINDOW_OBJECT (window)->state & GDK_WINDOW_STATE_WITHDRAWN)) + [parent_impl->toplevel addChildWindow:window_impl->toplevel ordered:NSWindowAbove]; } } -- 2.30.2